

package com.zmks.jkgj.xuexiao.controller;




import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import com.zmks.jkgj.core.controller.ABaseController;
import com.zmks.jkgj.core.resp.Resp;
import com.zmks.jkgj.xuexiao.SessionManager;
import com.zmks.jkgj.xuexiao.resp.WebResp;
import com.zmks.jkgj.xuexiao.service.ICrctObjStudentService;
import com.zmks.jkgj.xuexiao.service.ICrctObjTeacherService;
import com.zmks.jkgj.xuexiao.service.ICrctRelClassTeacherService;
import com.zmks.jkgj.xuexiao.vo.CrctObjStudentVO;
import com.zmks.jkgj.xuexiao.vo.CrctObjTeacherVO;
import com.zmks.jkgj.xuexiao.vo.CrctRelClassTeacherVO;

@Controller
public class CrctRelClassTeacherController extends ABaseController {
	

        @Autowired
	
	private ICrctRelClassTeacherService crctRelClassTeacherService;	

        @Autowired
    	
    	private ICrctObjTeacherService crctObjTeacherService;	

	 //查询代课老师
	@RequestMapping("/get_CrctRelClassTeacher_list_daike")
	@ResponseBody
	public Resp get_crctObjStudent_list(Long class_oid ,HttpServletRequest request) {
		WebResp 	webResp = new WebResp();
		CrctRelClassTeacherVO vs=	new CrctRelClassTeacherVO();
	   String  school_oid = SessionManager.getsession(request).getSchool_oid();
	   vs.setClass_oid(class_oid);
	   vs.setPosition_oid(1L);
	  List<CrctRelClassTeacherVO>  vlist=   crctRelClassTeacherService.getList(vs);
	  List list=new java.util.ArrayList();
	  for (int i=0 ;i<vlist.size();i++)
	   {
		   CrctRelClassTeacherVO v= vlist.get(i);
		      HashMap map=new HashMap();
		      CrctObjTeacherVO  crctObjTeacherVO= crctObjTeacherService.get(v.getTeacher_oid());
		      map.put("id", crctObjTeacherVO.getId());
		      map.put("name", crctObjTeacherVO.getName());
		      map.put("subject", crctObjTeacherVO.getSubject());
		      list.add(map);
		 }
	   

    		webResp.setData(list);

		return webResp;
	}
	
	

}
